HASH_SHA[1]

Purpose

This function computes a hash value by using the SHA1 algorithm (160 Bit).

Syntax

hash_sha1::=

Hash_Sha1

Usage Notes

  • Return values have data type CHAR(40) and contain hex characters.
  • The data types of the input parameters are significant. That is why HASH_SHA1(123) is different to HASH_SHA1('123').
  • Multiple input expressions are concatenated (in their internal byte representation) before the hash value is computed.
  • HASH_SHA1(c1,c2) is not similar to HASH_SHA1(c1||c2).

  • The function returns NULL if all input expressions are NULL.
  • HASH_SHA() is an alias for HASH_SHA1().

Example

SELECT HASH_SHA1('abc');